-- card: 54516 from stack: in -- bmap block id: 0 -- flags: 0000 -- background id: 4755 -- name: -- part contents for background part 4 ----- text ----- TC/C++ CONSIDERATIONS When taking advantage of the ability to define classes in TC and C++, it is common practice to place each class definition in a header file, and the definitions of the member functions of the class in a separate source file. In the example in Chapter 4 the Person class was defined in 'person.h' and its methods in 'person.c'. The source file #includes the corresponding header, as do all files which make use of the Person class definition; namely 'student.h' and 'main.c'. Notice that 'main.c' #includes 'student.h' as well. This suggests that the contents of 'person.h' are included twice in 'main.c', producing an error due to duplicate definition. To avoid this, Think C allows the programmer to place the directive: # define _H_person.h at the beginning of the header 'person.h'. This ensures the file's contents are compiled only once. In C++ conditional compilation must be made explicitly, as discussed in the following section. -- part contents for background part 7 ----- text ----- 177